package com.ms.student.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ms.student.mapper.StudentMapper;
import com.ms.student.model.Student;
import com.ms.student.service.StudentService;

/**
* @comments
* @author  zg
* @date 2021年7月5日
*/
@Service
public class StudentServiceImpl implements StudentService {
    
    @Autowired
    private StudentMapper studentMapper;

    @Override
    public List<Student> list() {
        
        return studentMapper.selectAll();
    }

    @Override
    public void add(Student stu) {
        studentMapper.insertSelective(stu);
    }

    @Override
    public void delete(Integer id) {
        studentMapper.deleteByPrimaryKey(id);
    }

    @Override
    public Student getById(Integer id) {
            
        return studentMapper.selectByPrimaryKey(id);
    }

    @Override
    public void updateById(Student stu) {
        studentMapper.updateByPrimaryKeySelective(stu);
    }

}
